package com.xxgc.eow.service.impl;

import com.xxgc.eow.entity.Companytopic;
import com.xxgc.eow.mapper.CompanytopicMapper;
import com.xxgc.eow.service.ICompanytopicService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 企业题目 服务实现类
 * </p>
 *
 * @author Mr.Abel
 * @since 2023-06-04
 */
@Service
public class CompanytopicServiceImpl extends ServiceImpl<CompanytopicMapper, Companytopic> implements ICompanytopicService {

    @Resource
    private  CompanytopicMapper companytopicMapper;

    @Override
    public int add(Companytopic companytopic) {
        return companytopicMapper.insert(companytopic);
    }

    @Override
    public int updat(Companytopic companytopic) {
        return companytopicMapper.updateCompanyInt(companytopic);
    }

    @Override
    public List<Companytopic> getAll(int companyId) {
        return companytopicMapper.selectByCompanyId(companyId);
    }

    @Override
    public List<Companytopic> getBylibraryId(int libraryId) {
        return companytopicMapper.selectAllByLibraryId(libraryId);
    }
}
